package com.lzw.controller.student;

import com.lzw.anno.Log;
import com.lzw.pojo.Student;
import com.lzw.service.student.StudentS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@CrossOrigin(origins = "http://localhost:7070")
@RestController
@RequestMapping("/SC")
public class StudentC {

    @Autowired
    private StudentS studentS;

    //查找个人信息
    @GetMapping("/{username}")
    public Map<String,Object> getPersonInfo(@PathVariable String username){
        return studentS.getInfo(username);
    }

    //修改个人信息
    @Log
    @PutMapping("/update")
    public String update(@RequestBody Student student){
        studentS.update(student);
        return "更新成功";
    }
}
